<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        // let main = function(){

        //     console.log(this);
        // }

        // let main = () => {

        //     console.log(this);
        // }
    
        // let obj = {
        //     name:'obj',
        //     func : main,
        //     obj:{
        //         func : main
        //     }
        // }

        // main();
        // obj.func();

        // obj.obj.func();

        // function Person(name){

        //     this.name = name;
        // }

        // let Person = (name)=>{

        //     this.name = name;
        // }

        // new Person('di ');
        // window.birth = 1992;
        // let obj = {
        //     birth: 1990,
        //     getAge:  () => {
        //         let b = this.birth;

        //         console.log('b ===>',b);
        //         let fn =  () => { 

        //             // * ===> 2021
        //             console.log('inner ===>',this.birth);
        //             console.log(new Date().getFullYear() - this.birth) 
        //         };
        //         return fn();
        //     }
        // };

        // obj.getAge();
        // var x = 'out'
        // let obj1 = {
        //     x: 22,
        //     say: function () { console.log(this.x) },
        //     say2: () => { console.log(this.x) },
        //     say3: function(){

        //             // * this ===> obj1
        //             const func = () => {

        //                 // * this ===> obj1
        //                 console.log(this.x)
        //             }

        //             return func;
        //         }
        //     }
        // obj1.say(); // ==>
        // obj1.say2(); 
        // const func = obj1.say3();

        // let obj2 = {
        //     func : func
        // }

        // obj2.func();
        let data = [
   {name:'A',score:90},
   {name:'B',score:82},
   {name:'C',score:100},
   {name:'D',score:71},
   {name:'E',score:81},
   {name:'F',score:92},
   {name:'G',score:72},
   {name:'H',score:61},
   {name:'I',score:71},
   {name:'J',score:51},
   {name:'K',score:90},
   {name:'L',score:82},
   {name:'M',score:74},
   {name:'N',score:71},
   {name:'O',score:81}
]

let goodNum = 0;
date.map(item =>{
   if(item.score>=85){
      goodNum++
   }
})
console.log('优秀的数量是',goodNum)

    </script>
</body>
</html>